import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter) // VueRouter插件初始化

// 一级路由
import Home from '../work/Home.vue'
import Login from '../work/Login.vue'

//二级路由
import First from '../work/Sub/First.vue'
import Second from '../work/Sub/Second.vue'
import Third from '../work/Sub/Third.vue'
import Forth from '../work/Sub/Forth.vue'

//三级
import Monday from '../work/Sub/Monday.vue'
import Tuesday from '../work/Sub/Tuesday.vue'
import Wednesday from '../work/Sub/Wednesday.vue'


const router = new VueRouter({
  // routes 路由规则们
  // route  一条路由规则 { path: 路径, component: 组件 }
  routes: [
    {
      path: '/',
      name: 'Login',
      component: Login
    },
    {
      path: '/home',
      name: 'Home',
      component: Home,
      redirect: '/first',
      children: [
        {
          path: '/first',
          name: 'First',
          component: First,
          children:[
            {
              path: '/monday',
              name: 'Monday',
              component: Monday
            },
            {
              path: '/tuesday',
              name: 'Tuesday',
              component: Tuesday
            },
            {
              path: '/wednesday',
              name: 'Wednesday',
              component: Wednesday
            },
          ]
        },
        {
          path: '/second',
          name: 'Second',
          component: Second
        },
        {
          path: '/third/:ss',
          name: 'Third',
          component: Third
        },
        {
          path: '/forth/:ss',
          name: 'Forth',
          component: Forth
        },
      ]
    },
  ]
})
export default router